import { _decorator, Component, Node } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('DataComp')
export class DataComp extends Component {

    @property
    num: number = 1;

    @property
    str: string = 'name'

    @property(Node)
    target: Node = null;

    start() {
        for (let key in this) {
            let obj=new Object();
            
            console.log(key, isObject(this[key]));
        }
    }

    update(deltaTime: number) {

    }
}

function isObject(value: any): boolean {
    return value !== null && typeof value === 'object';
}